from typing import List

import numpy as np


class Trader:
    def __init__(self, noisy_degree: float):
        self.noisy_degree = noisy_degree

    def expect(self, noisy_probability: float):
        return np.random.normal(noisy_probability, self.noisy_degree)

    @classmethod
    def bulk_create(cls, trader_num: int, noisy_ratio: float, noisy_degree: float) -> List["Trader"]:
        return [cls(noisy_degree if i < trader_num * noisy_ratio else 0) for i in range(trader_num)]
